#include <bits/stdc++.h>
#include <regex>
#include "testlib.h"

using namespace std;

int main(int argc, char* argv[]) {
    registerValidation(argc, argv);
    int group = atoi(validator.group().c_str());
    if (group == 0) group = 1;
    ensure (group == 1 || group == 2 || group == 3);
    int max_val = 1000;
    if (group == 2) max_val = 1000000;
    if (group == 3) max_val = 1000000000;
    int a = inf.readInt(1, max_val - 1, "A");
    inf.readEoln();
    inf.readInt(a + 1, max_val, "B");
    inf.readEoln();
    inf.readEof();
}
